package cn.foolishbird.crow.core;

import java.util.Objects;

/**
 * @author foolish bird
 * @email luohongtu@foolishbird.cn
 */
public abstract class IdSObject<ID> extends SObject implements IdObject<ID> {

    private static final long serialVersionUID = -8048956553924177160L;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        IdSObject<ID> that = (IdSObject<ID>) o;
        return id().equals(that.id());
    }

    @Override
    public int hashCode() {
        return Objects.hash(id());
    }

}
